
/*
 * Adds rounded corners to the given element.
 * Thanks to Google for the idea!
 */
function roundCorners(obj) {
	obj.insert({top: '<div class="round1"></div>'});
	obj.insert({bottom: '<div class="round1"></div>'});
	obj.insert({top: '<div class="round2"></div>'});
	obj.insert({bottom: '<div class="round2"></div>'});
	obj.insert({top: '<div class="round4"></div>'});
	obj.insert({bottom: '<div class="round4"></div>'})
}

/* 
 * Applies rounded corners to all elements with
 * 'rounded' in its class attribute.
 */ 
function applyRoundCorners() {
	var elements = document.getElementsByClassName('rounded');
	for (var i = 0; i < elements.length; i++) {
		roundCorners(elements[i]);
	}
}